package code;

public class Player extends MovableObject
{
	private boolean isDead; //quizas no haga falta ninguna de las dos
	private boolean hasWon;
	
	public Player(String texture)
	{
		super(texture);
		isDead = false;
		hasWon = false;
	}
	
	@Override
	public Boolean attemptMove(Direction dir)
	{
		ContainerCell origin = this.getCurrentCell();
		Cell target  = origin.cellAt(dir);
		
		if(target.makeAvailable(dir))
		{
			this.moveTo((ContainerCell)target);
			return true;
		}
		
		return false;
	}
	
	public void kill()
	{
		isDead = true;
		System.out.println("MURIO EL PLAYER"); //sacar despues
	}
	
	public void win()
	{
		hasWon = true;
		System.out.println("YOU ARE WINRAR"); //sacar despues
	}
	
	public void isOnWater()
	{
		isDead = true;
		kill();
	}
	
	public boolean activatesGoal()
	{
		return true;
	}
}
